import { createRouter, createWebHashHistory } from 'vue-router'
import { appRoutes } from '@renderer/router/routes'
import { beforeEach, afterEach } from '@renderer/router/guards'

const appRouter = createRouter({
  history: createWebHashHistory(), // hash模式
  routes: appRoutes // 路由配置规则数组
})

// 前置路由
appRouter.beforeEach(beforeEach)
// 后置路由
appRouter.afterEach(afterEach)

export default appRouter
